<template>
  <el-table-column v-for="item in tableView" :key="item.name" :label="item.title" :prop="item.name" :width="item.width">
    <template #default="{ row }">
      <component :is="componentMap[item.type] || componentMap.default" v-if="item.type"
        :data="row.cfv?.[item.name] || '--'" />
    </template>
  </el-table-column>
</template>
<script setup lang="ts">
import { CustomInputTableDisplay, CustomSelectTableDisplay, CustomDefaultTableDisplay } from '../dynamic-form-field'
import { toRefs } from 'vue';
const props = defineProps<{
  tableView: any[]; //视图设置
}>();
const { tableView } = toRefs(props);
const componentMap: any = {
  input: CustomInputTableDisplay,
  select: CustomSelectTableDisplay,
  default: CustomDefaultTableDisplay
};
</script>
<style></style>